package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementMplsLsridMapper;
import com.ruoyi.net.domain.ElementMplsLsrid;
import com.ruoyi.net.service.IElementMplsLsridService;

/**
 * 网元-MPLS LSR IDService业务层处理
 * 
 * @author xxcg
 * @date 2024-11-19
 */
@Service
public class ElementMplsLsridServiceImpl implements IElementMplsLsridService 
{
    @Autowired
    private ElementMplsLsridMapper elementMplsLsridMapper;

    /**
     * 查询网元-MPLS LSR ID
     * 
     * @param id 网元-MPLS LSR ID主键
     * @return 网元-MPLS LSR ID
     */
    @Override
    public ElementMplsLsrid selectElementMplsLsridById(String id)
    {
        return elementMplsLsridMapper.selectElementMplsLsridById(id);
    }

    /**
     * 查询网元-MPLS LSR ID列表
     * 
     * @param elementMplsLsrid 网元-MPLS LSR ID
     * @return 网元-MPLS LSR ID
     */
    @Override
    public List<ElementMplsLsrid> selectElementMplsLsridList(ElementMplsLsrid elementMplsLsrid)
    {
        return elementMplsLsridMapper.selectElementMplsLsridList(elementMplsLsrid);
    }

    /**
     * 新增网元-MPLS LSR ID
     * 
     * @param elementMplsLsrid 网元-MPLS LSR ID
     * @return 结果
     */
    @Override
    public int insertElementMplsLsrid(ElementMplsLsrid elementMplsLsrid)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementMplsLsrid.getId())) {
            elementMplsLsrid.setId(uuid);
        }
        elementMplsLsrid.setCreateBy(SecurityUtils.getUsername());
        elementMplsLsrid.setCreateTime(DateUtils.getNowDate());
        elementMplsLsrid.setUpdateBy(SecurityUtils.getUsername());
        elementMplsLsrid.setUpdateTime(DateUtils.getNowDate());
        return elementMplsLsridMapper.insertElementMplsLsrid(elementMplsLsrid);
    }

    /**
     * 修改网元-MPLS LSR ID
     * 
     * @param elementMplsLsrid 网元-MPLS LSR ID
     * @return 结果
     */
    @Override
    public int updateElementMplsLsrid(ElementMplsLsrid elementMplsLsrid)
    {
        elementMplsLsrid.setUpdateBy(SecurityUtils.getUsername());
        elementMplsLsrid.setUpdateTime(DateUtils.getNowDate());
        return elementMplsLsridMapper.updateElementMplsLsrid(elementMplsLsrid);
    }

    /**
     * 批量删除网元-MPLS LSR ID
     * 
     * @param ids 需要删除的网元-MPLS LSR ID主键
     * @return 结果
     */
    @Override
    public int deleteElementMplsLsridByIds(String[] ids)
    {
        return elementMplsLsridMapper.deleteElementMplsLsridByIds(ids);
    }

    /**
     * 删除网元-MPLS LSR ID信息
     * 
     * @param id 网元-MPLS LSR ID主键
     * @return 结果
     */
    @Override
    public int deleteElementMplsLsridById(String id)
    {
        return elementMplsLsridMapper.deleteElementMplsLsridById(id);
    }
}
